package com.xzy.e;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 自动依赖注入的方式：@Autowired + 属性|方法
 *
 * @author xzy
 * @date 2021/12/7  21:47
 */
public class Main {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(BeanConfig.class);
        applicationContext.register(AutowiredServiceImpl.class);

        System.out.println(applicationContext.getBean(AutowiredServiceImpl.class));
    }
}
